package com.tvalition.pojo;

import com.tvalition.annoation.ValidList;
import com.tvalition.valInterface.Vadilation1Group;
import com.tvalition.valInterface.Vadilation2Group;
import lombok.Data;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author: LCG
 * @date: 2023-03-20 14:10:26
 * @description:
 **/
@Data
public class TestParams {

   @NotNull
   private String dropTime;

   //嵌套的校验
   @ValidList(groups = {Vadilation2Group.class},className = TestDropInfo.class)
   private List<@Valid TestDropInfo> list;

   @NotNull(groups = {Vadilation1Group.class})
   private String value1;

   //value2 会在 Vadilation1Group 校验
   @NotNull(groups = {Vadilation1Group.class})
   private String value2;

   //value3 会在 Vadilation1Group Vadilation2Group都会校验
   @NotNull(groups = {Vadilation1Group.class, Vadilation2Group.class})
   private String value3;

   //value4 会在 Vadilation2Group 校验
   @NotNull(groups = {Vadilation2Group.class})
   private String value4;


}
